package cn.itcast.feign.client;
import cn.itcast.hmall.dto.common.PageDTO;
import cn.itcast.hmall.dto.item.SearchItemDTO;
import cn.itcast.hmall.pojo.item.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 商品服务 Feign接口
 *
 * TODO 需要远程调用的方法自己补充哦
 *
 */
@FeignClient("itemservice")
public interface ItemClient {
    /**
     *分页查询商品
     * @return
     */
    @PostMapping("/item/list")
     PageDTO<Item> findGoodsByPage(@RequestBody SearchItemDTO searchItemDTO);
    //根据id查询商品
    @GetMapping("/item/{id}")
    public Item findGoodsById(@PathVariable String id);
    //修改库存
    @PutMapping("/item/stock/{itemId}/{num}")
    public void reductionInventory(@PathVariable("itemId") String itemId,@PathVariable("num") String num);
    //修改库存
    @PutMapping("/item/stock/add/{itemId}/{num}")
    public void addInventory(@PathVariable("itemId") String itemId,@PathVariable("num") String num);

}
